

#include "nativeTypes.h"
#include "abstractTree.h"
#include "eval.h"
Generic Main(const Generic & root) {

  // Register extras Components


  // Read/Execute Main.xml
  awa::ComputationFlow flow( readFromSrc( "main.xml" ) );
  for(AbstractTree::node_iterator i = flow->node_begin(); i != flow->node_end(); i++)
    eval(Generic(*i));

  // Call Registered Main Function
  TypeCollection::iterator itrType;
  ObjectCollection::iterator itrObj;
  if((itrType = NativeTypes.find("awa")) != NativeTypes.end())
    if((itrObj = itrType->second.find("Main")) != itrType->second.end()) 
      if(*(itrObj->second.begin()) == "Main")
	return (*(static_cast<boost::function1<Generic , Generic>* >(itrObj->first)))(root);
		    
}
